/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.hera.process.config.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import com.hera.base.domain.BaseDomain;
import com.hera.process.security.domain.User;

/**
 *
 * @author cmontes
 */
@Entity
@Table(name = "LOGIN_METHOD")
public class LoginMethod extends BaseDomain implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "LoginMethod")
    @TableGenerator(name = "LoginMethod", table = "sequence", pkColumnName = "seq_name", valueColumnName = "seq_id", pkColumnValue = "LoginMethod", allocationSize = 1)
    @Column(name = "ID_LOGIN_METHOD")
    private Long idLoginMethod;
    @ManyToOne
    @JoinColumn(name="TYPE_ID")
    private ParameterDetail type;
    @Column(name = "SERVER_NAME")
    private String serverName;
    @Column(name = "LDAP_BASE_DN")
    private String ldapBaseDn;
    @Column(name = "SERVER_PORT")
    private String serverPort;
    private String name;
    @Column(name = "USER_SUPERVISOR_DN")
    private String userSupervisorDn;
    //@OneToMany(mappedBy = "loginMethod")
    @Transient
    private List<User> sysUserList;

    public LoginMethod() {
    }

    public LoginMethod(Long idLoginMethod) {
        this.idLoginMethod = idLoginMethod;
    }

    public Long getIdLoginMethod() {
        return idLoginMethod;
    }

    public void setIdLoginMethod(Long idLoginMethod) {
        this.idLoginMethod = idLoginMethod;
    }

    public String getServerName() {
        return serverName;
    }

    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    public String getLdapBaseDn() {
        return ldapBaseDn;
    }

    public void setLdapBaseDn(String ldapBaseDn) {
        this.ldapBaseDn = ldapBaseDn;
    }

    public String getServerPort() {
        return serverPort;
    }

    public void setServerPort(String serverPort) {
        this.serverPort = serverPort;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUserSupervisorDn() {
        return userSupervisorDn;
    }

    public void setUserSupervisorDn(String userSupervisorDn) {
        this.userSupervisorDn = userSupervisorDn;
    }

    public List<User> getSysUserList() {
        return sysUserList;
    }

    public void setSysUserList(List<User> sysUserList) {
        this.sysUserList = sysUserList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idLoginMethod != null ? idLoginMethod.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        
        if (!(object instanceof LoginMethod)) {
            return false;
        }
        LoginMethod other = (LoginMethod) object;
        if ((this.idLoginMethod == null && other.idLoginMethod != null) || (this.idLoginMethod != null && !this.idLoginMethod.equals(other.idLoginMethod))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.hera.process.data.domain2.LoginMethod[ idLoginMethod=" + idLoginMethod + " ]";
    }

	public ParameterDetail getType() {
		return type;
	}

	public void setType(ParameterDetail type) {
		this.type = type;
	}
    
}
